
const baseUrl = process.env.NODE_ENV==='development'?'':'https://music.163.com';

export interface IApiType {
    getMusicDetailById: string;
    search: string;
    getPlayList: string;
    getComment: string;
    getLyric: string;
}

type TApi = keyof IApiType;
 
const api: IApiType = {
    /** 获取歌曲详情 */
    getMusicDetailById: '/api/song/detail/',
    /** 搜索 */
    search: '/api/search/get/web',
    /** 获取歌单详情 */
    getPlayList: '/api/playlist/detail',
    /** 评论列表 */
    getComment: '/api/v1/resource/comments',
    /** 歌词 */
    getLyric: '/api/song/lyric'
}

Object.keys(api).forEach((key: string) => {
    const keyname = key as TApi;
    api[keyname] = baseUrl + api[keyname]
})

export default api